package cn.com.Kol.ITPMP.TenMajorAreas.model;

import cn.com.Kol.ITPMP.System.Area;
import cn.com.Kol.ITPMP.System.Process;

import static cn.com.Kol.ITPMP.System.Constants.*;

public class StakeholderManagement extends Area {

    private Process RecognizeStakeholder = new Process(RECOGNIZE_STAKEHOLDER);
    private Process MakeStakeholderManagementPlan = new Process(MAKE_STAKEHOLDER_MANAGEMENT_PLAN);
    private Process ManageStakeholderInvolvement = new Process(MANAGE_STAKEHOLDER_INVOLVEMENT);
    private Process ControlStakeholderInvolvement = new Process(CONTROL_STAKEHOLDER_INVOLVEMENT);
    
    private void StakeholderManagementProcess(){
        CreateProcess(RecognizeStakeholder);
        CreateProcess(MakeStakeholderManagementPlan);
        CreateProcess(ManageStakeholderInvolvement);
        CreateProcess(ControlStakeholderInvolvement);
    }

    public void SetInputs(Process process){
        switch (process.getProcessName()){
            case "识别干系人":
                process.inputs(PROJECT_CHARTER);
                process.inputs(PROCUREMENT_FILE);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "规划干系人管理":
                process.inputs(PROJECT_MANAGEMENT_PLAN);
                process.inputs(STAKEHOLDER_REGISTER);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "管理干系人参与":
                process.inputs(STAKEHOLDER_MANAGEMENT_PLAN);
                process.inputs(COMMUNICATION_MANAGEMENT_PLAN);
                process.inputs(CHANGE_REQUESTS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "控制干系人参与":
                process.inputs(PROJECT_MANAGEMENT_PLAN);
                process.inputs(ISSUE_LOG);
                process.inputs(WORK_PERFORMANCE_DATA);
                process.inputs(PROJECT_FILE);
                break;
        }
    }

    public void UseToolAndTech(Process process){
        switch (process.getProcessName()){
            case "识别干系人":
                process.useToolAndTech(STAKEHOLDER_ANALYSIS);
                process.useToolAndTech(EXPERT_JUDGEMENT);
                process.useToolAndTech(CONFERENCE);
                break;
            case "规划干系人管理":
                process.useToolAndTech(EXPERT_JUDGEMENT);
                process.useToolAndTech(CONFERENCE);
                process.useToolAndTech(ANALYSIS_TECHNICS);
                break;
            case "管理干系人参与":
                process.useToolAndTech(COMMUNICATIONS_METHOD);
                process.useToolAndTech(INTERPERSONAL_RELATIONSHIP_SKILLS);
                process.useToolAndTech(MANAGEMENT_SKILLS);
                break;
            case "控制干系人参与":
                process.useToolAndTech(INFORMATION_MANAGEMENT_SYSTEM);
                process.useToolAndTech(EXPERT_JUDGEMENT);
                process.useToolAndTech(CONFERENCE);
                break;
        }
    }

    public void SetOutputs(Process process){
        switch (process.getProcessName()){
            case "识别干系人":
                process.outputs(STAKEHOLDER_REGISTER);
                break;
            case "规划干系人管理":
                process.outputs(STAKEHOLDER_MANAGEMENT_PLAN);
                process.outputs(PROJECT_FILE_UPDATE);
                break;
            case "管理干系人参与":
                process.outputs(ISSUE_LOG);
                process.outputs(CHANGE_REQUESTS);
                process.outputs(PROJECT_MANAGEMENT_PLAN_UPDATE);
                process.outputs(PROJECT_FILE_UPDATE);
                process.outputs(ORGANIZATIONAL_PROCESS_ASSETS_UPDATE);
                break;
            case "控制干系人参与":
                process.outputs(WORK_PERFORMANCE_INFO);
                process.outputs(CHANGE_REQUESTS);
                process.outputs(PROJECT_MANAGEMENT_PLAN_UPDATE);
                process.outputs(PROJECT_FILE_UPDATE);
                process.outputs(ORGANIZATIONAL_PROCESS_ASSETS_UPDATE);
                break;

        }

    }
}
